EPD Extension Kit for MSP430 LaunchPad
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Enumerations | Functions | Variables
EPD_COG_process.h File Reference

The definition of COG driving data and process. More...

#include "Pervasive_Displays_small_EPD.h"

Go to the source code of this file.

Classes

union  COG_line_data_packet_type
 Packet structure of a line data. More...
 
struct  COG_parameters_t
 Define the COG driver's parameters. More...
 

Macros

#define BLACK0   (uint8_t)(0x03)
 The definition for driving stage to compare with for getting Odd and Even data. More...
 
#define BLACK1   (uint8_t)(0x0C)
 
#define BLACK2   (uint8_t)(0x30)
 
#define BLACK3   (uint8_t)(0xC0)
 
#define WHITE0   (uint8_t)(0x02)
 
#define WHITE1   (uint8_t)(0x08)
 
#define WHITE2   (uint8_t)(0x20)
 
#define WHITE3   (uint8_t)(0x80)
 
#define NOTHING0   (uint8_t)(0x01)
 
#define NOTHING1   (uint8_t)(0x04)
 
#define NOTHING2   (uint8_t)(0x10)
 
#define NOTHING3   (uint8_t)(0x40)
 
#define NOTHING   (uint8_t)(0x55)
 
#define ALL_BLACK   (uint8_t)(0xFF)
 
#define ALL_WHITE   (uint8_t)(0xAA)
 
#define BORDER_BYTE_B   (uint8_t)(0xFF)
 
#define BORDER_BYTE_W   (uint8_t)(0xAA)
 
#define ERROR_BUSY   (uint8_t)(0xF0)
 
#define ERROR_COG_ID   (uint8_t)(0xF1)
 
#define ERROR_BREAKAGE   (uint8_t)(0xF2)
 
#define ERROR_DC   (uint8_t)(0xF3)
 
#define ERROR_CHARGEPUMP   (uint8_t)(0xF4)
 
#define RES_OK   (uint8_t)(0x00)
 
#define LINE_BUFFER_DATA_SIZE   111
 The COG Driver uses a buffer to update the EPD line by line. More...
 
#define COUNT_OF_EPD_TYPE   3
 Support 1.44", 2" and 2.7" three type EPD currently.
 

Enumerations

enum  Stage { Stage1, Stage2, Stage3, Stage4 }
 Four driving stages. More...
 

Functions

void EPD_init (void)
 Initialize the EPD hardware setting.
 
void EPD_power_on (void)
 Power on COG Driver. More...
 
uint8_t EPD_initialize_driver (uint8_t EPD_type_index)
 Initialize COG Driver. More...
 
void EPD_display_from_array_prt (uint8_t EPD_type_index, uint8_t *previous_image_ptr, uint8_t *new_image_ptr)
 Write image data from memory array to the EPD. More...
 
void EPD_display_from_flash_prt (uint8_t EPD_type_index, long previous_image_flash_address, long new_image_flash_address, EPD_read_flash_handler On_EPD_read_flash)
 Write image data from Flash memory to the EPD. More...
 
uint8_t EPD_power_off (uint8_t EPD_type_index)
 Power Off COG Driver. More...
 
void COG_driver_EPDtype_select (uint8_t EPD_type_index)
 Select the EPD size to get line data array for driving COG. More...
 

Variables

struct COG_parameters_t COG_parameters [COUNT_OF_EPD_TYPE]
 The COG parameters of different EPD size.
 
const uint8_t SCAN_TABLE [4]
 

Detailed Description

The definition of COG driving data and process.

Copyright (c) 2012-2013 Pervasive Displays Inc. All rights reserved.

Authors: Pervasive Displays Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

#define BLACK0   (uint8_t)(0x03)

The definition for driving stage to compare with for getting Odd and Even data.

getting bit1 or bit0 as black color(11)

#define BLACK1   (uint8_t)(0x0C)

getting bit3 or bit2 as black color(11)

#define BLACK2   (uint8_t)(0x30)

getting bit5 or bit4 as black color(11)

#define BLACK3   (uint8_t)(0xC0)

getting bit7 or bit6 as black color(11)

#define LINE_BUFFER_DATA_SIZE   111

The COG Driver uses a buffer to update the EPD line by line.

Note
Use the 2.7" maximum data(66)+scan(44)+dummy(1) bytes as line buffer size=111.
#define NOTHING   (uint8_t)(0x55)

sending Nothing frame, 01=Nothing, 0101=0x5

#define NOTHING0   (uint8_t)(0x01)

getting bit1 or bit0 as nothing input(01)

#define NOTHING1   (uint8_t)(0x04)

getting bit3 or bit2 as nothing input(01)

#define NOTHING2   (uint8_t)(0x10)

getting bit5 or bit4 as nothing input(01)

#define NOTHING3   (uint8_t)(0x40)

getting bit7 or bit6 as nothing input(01)

#define WHITE0   (uint8_t)(0x02)

getting bit1 or bit0 as white color(10)

#define WHITE1   (uint8_t)(0x08)

getting bit3 or bit2 as white color(10)

#define WHITE2   (uint8_t)(0x20)

getting bit5 or bit4 as white color(10)

#define WHITE3   (uint8_t)(0x80)

getting bit7 or bit6 as white color(10)

Enumeration Type Documentation

enum Stage

Four driving stages.

Enumerator
Stage1 

Inverse previous image

Stage2 

White

Stage3 

Inverse new image

Stage4 

New image

Function Documentation

void COG_driver_EPDtype_select ( uint8_t  EPD_type_index)

Select the EPD size to get line data array for driving COG.

Parameters
EPD_type_indexThe defined EPD size
void EPD_display_from_array_prt ( uint8_t  EPD_type_index,
uint8_t *  previous_image_ptr,
uint8_t *  new_image_ptr 
)

Write image data from memory array to the EPD.

Note
For more detail on driving stages, please refer to COG document Section 5.
Parameters
EPD_type_indexThe defined EPD size
previous_image_ptrThe pointer of memory that stores previous image
new_image_ptrThe pointer of memory that stores new image
void EPD_display_from_flash_prt ( uint8_t  EPD_type_index,
long  previous_image_flash_address,
long  new_image_flash_address,
EPD_read_flash_handler  On_EPD_read_flash 
)

Write image data from Flash memory to the EPD.

Parameters
EPD_type_indexThe defined EPD size
previous_image_flash_addressThe previous image address of flash memory
new_image_flash_addressThe new image address of flash memory
On_EPD_read_flashDeveloper needs to create an external function to read flash
uint8_t EPD_initialize_driver ( uint8_t  EPD_type_index)

Initialize COG Driver.

Note
For detailed flow and description, please refer to the COG document Section 4.
Parameters
EPD_type_indexThe defined EPD size
uint8_t EPD_power_off ( uint8_t  EPD_type_index)

Power Off COG Driver.

Note
For detailed flow and description, please refer to the COG document Section 6.
Parameters
EPD_type_indexThe defined EPD size
void EPD_power_on ( void  )

Power on COG Driver.

Note
For detailed flow and description, please refer to the COG document Section 3.